class UserInfoModel {
  final String id;
  final String? avatar;
  final String? nickName;

  UserInfoModel({
    required this.id,
    this.avatar,
    this.nickName,
  });

  // 工厂构造方法，用于从JSON数据创建UserInfoModel实例喵
  factory UserInfoModel.fromJson(Map<String, dynamic> json) {
    return UserInfoModel(
      id: json['id'] ?? '',
      avatar: json['avatar'] ?? '',
      nickName: json['nickName'] ?? '',
    );
  }

  // 将UserInfoModel转换为JSON的方法喵
  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'avatar': avatar,
      'nickName': nickName,
    };
  }

  UserInfoModel copyWith({
    String? id,
    String? avatar,
    String? nickName,
  }) {
    return UserInfoModel(
      id: id ?? this.id,
      avatar: avatar ?? this.avatar,
      nickName: nickName ?? this.nickName,
    );
  }
}

//UploadResponse
class UploadResponse {
  final String url;

  UploadResponse({required this.url});

  factory UploadResponse.fromJson(Map<String, dynamic> json) {
    return UploadResponse(url: json['url'] ?? '');
  }
}
